- content_for :title_header do
  %h1
    = t("layouts.admin.admin")
    = "-"
    = t(".edit_price_field")

- content_for :extra_javascript do
  :javascript
    initialize_admin_edit_price($("#edit_community"), "community[price_filter_min]", "community[price_filter_max]", "#{I18n.locale}");

= render :partial => "admin/left_hand_navigation", :locals => { :links => admin_links_for(@current_community) }

.left-navi-section
  = form_for @community, :as => :community, :url => update_price_admin_custom_fields_path, :method => :put do |form|

    - min = MoneyUtil.to_units(MoneyUtil.to_money(@current_community.price_filter_min, @current_community.currency)) || 0
    - max = MoneyUtil.to_units(MoneyUtil.to_money(@current_community.price_filter_max, @current_community.currency)) || 100000

    .row
      .col-12
        .checkbox-container
          = form.check_box :show_price_filter
          = form.label :show_price_filter, t("admin.custom_fields.form.search_filter.search_filter")

    .row
      .col-3
        = form.label "community[price_filter_min]", t(".price_min")
        = text_field_tag "community[price_filter_min]", min, :class => "required number-no-decimals"
      .col-3
        = form.label "community[price_filter_max]", t(".price_max")
        = text_field_tag "community[price_filter_max]", max, :class => "required number-no-decimals"

    .row
      .col-12
        = render :partial => "layouts/info_text", :locals => { :text => t("admin.custom_fields.edit_price.description") }

    = render :partial => "admin/custom_fields/form/buttons", :locals => { :form => form }
